package de.se2.sharebox.classes;

import java.util.Vector;

/**
 *
 * The collection of Accounts, simulate our DB with Accounts
 *
 * @author Gruppe 10
 *
 */
public class FoldersCollection
{

	private Vector<Folder> folderCollection = new Vector<Folder>();

	/**
	 * alle Folders bekommen
	 */
	public Vector<Folder> getFolderCollection()
	{
		return this.folderCollection;
	}

	/**
	 * alle Folders einsetzen
	 */
	public void setFolderCollection(Vector<Folder> folder)
	{
		this.folderCollection = folder;
	}

	/**
	 * Einige fiktive Folders einfuegen create Collection of Folders with its
	 * name, type and file and folderCollection inside
	 */
	public FoldersCollection()
	{
		for (UserAccount account : AccountsCollection.getInstance().getAccounts())
		{
			Vector<File> fileCollection = new Vector<File>();
			Vector<Folder> folderCollection = new Vector<Folder>();
			fileCollection.add(new File("File1.txt", account, 40));
			fileCollection.add(new File("File2.txt", account, 50));
			folderCollection.add(new Folder("Ordner1", account, fileCollection, null));
			folderCollection.add(new Folder("Ordner2", account));
			Folder folder = new Folder("Main", account, fileCollection, folderCollection);
			this.folderCollection.add(folder);
		}
	}

	/**
	 * add new Folder into DB FolderCollection
	 */
	public void addFolder(Folder folder)
	{
		this.folderCollection.add(folder);
	}

}
